﻿#ifndef SEARCHROTATELISTS_H_
#define SEARCHROTATELISTS_H_

namespace algorithm {
    /**
     * @brief 整数数组 nums 按升序排列，数组中的值互不相同，数组nums会预先旋转再传入，
     * 旋转形如：[0,1,2,4,5,6,7] 在下标 3 处经旋转后可能变为 [4,5,6,7,0,1,2]，要求从旋转
     * 后的nums中寻找target.
     * https://leetcode.cn/problems/search-in-rotated-sorted-array/description/
     */
    class CSearchRotateLists
    {
    public:
        static int Search(std::vector<int>& nums, int target);

    private:
        static int BinarySearch(std::vector<int>& nums, int left, int right, int target);
    };
}

#endif //!SEARCHROTATELISTS_H_
